package com.share.wechat.order.entity;


import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * 用户和订单之间的中间表
 * 实现多对多的关系
 *
 */
@Entity
@Table(name = "WEB_USER_ORDER_REL")
public class OrderWithUser {
    /**
     * 主键
     */
    @Id
    private String id;
    /**
     * 用户信息
     */
    private String userInfo;
    /**
     * 商品id
     */
    private String detailId;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 创建时间
     */
    private Date updateTime;
    /**
     * 该条记录是否是可用的
     */
    private int isUseful;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserInfo() {
        return userInfo;
    }

    public void setUserInfo(String userInfo) {
        this.userInfo = userInfo;
    }

    public String getDetailId() {
        return detailId;
    }

    public void setDetailId(String detailId) {
        this.detailId = detailId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public int getIsUseful() {
        return isUseful;
    }

    public void setIsUseful(int isUseful) {
        this.isUseful = isUseful;
    }

    @Override
    public String toString() {
        return "OrderWithUser{" +
                "id='" + id + '\'' +
                ", userInfo='" + userInfo + '\'' +
                ", detailId='" + detailId + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", isUseful=" + isUseful +
                '}';
    }
}
